/**
 * FAC — Noto Sans Lao for the entire app (all pages, forms, modules)
 * Loaded LAST in the stylesheet chain so it always wins.
 * Bootstrap Icons glyph font is excluded.
 *
 * Stack: Noto Sans Lao first (Lao glyphs) → Noto Sans SC (Chinese) → Noto Sans (Latin)
 */

/* Self-hosted Noto Sans Lao (variable 300–700) so Lao renders without Google Fonts */
@font-face {
  font-family: "Noto Sans Lao";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/noto-sans-lao-lao.woff2") format("woff2");
  unicode-range: U+0E81-0EDF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Noto Sans Lao";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/noto-sans-lao-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
html,
html body {
  --font-family: "Noto Sans Lao", "Noto Sans SC", "Noto Sans", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-family-mono: "Noto Sans Lao", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: var(--font-family) !important;
}

/* Every DOM element except icon glyph fonts */
html body *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]) {
  font-family: "Noto Sans Lao", "Noto Sans SC", "Noto Sans", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Keep Bootstrap Icons */
html i.bi,
html [class^="bi-"],
html [class*=" bi-"],
html .bi::before,
html [class^="bi-"]::before,
html [class*=" bi-"]::before,
html body i.bi,
html body [class^="bi-"],
html body [class*=" bi-"],
html body .bi::before,
html body [class^="bi-"]::before,
html body [class*=" bi-"]::before {
  font-family: bootstrap-icons !important;
}

/* Form controls (browser UA stylesheet often overrides) */
html input,
html select,
html textarea,
html option,
html button,
html label,
html .form-control,
html .form-select,
html .btn,
html .badge,
html table,
html th,
html td,
html .modal,
html .toast,
html .card,
html .dropdown-menu,
html .sidebar,
html .topbar,
html .fac-export-menu,
html .its-notify-panel,
html .login-card,
html .fac-data-card,
html .fac-detail-drawer,
html .wizard,
html .filters-bar-card,
html .pagination-controls {
  font-family: "Noto Sans Lao", "Noto Sans SC", "Noto Sans", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

html input *,
html select *,
html textarea *,
html button *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]),
html .form-control,
html .btn *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]),
html .modal *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]),
html .toast *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]),
html .dropdown-menu *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]),
html .sidebar *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]),
html .topbar *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]),
html .fac-detail-drawer *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]),
html table *:not(i[class*="bi"]):not([class^="bi-"]):not([class*=" bi-"]) {
  font-family: "Noto Sans Lao", "Noto Sans SC", "Noto Sans", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Mono / code — still prefer Lao for mixed content */
html code,
html pre,
html kbd,
html samp,
html .mono {
  font-family: "Noto Sans Lao", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
}
